import { createRouter, createWebHistory } from "vue-router";

import Layout from "@/views/Main.vue";
import Dashboard from "@/views/dashboard/index.vue";

const routes = [
  {
    path: "/",
    redirect: "/dashboard"
  },
  {
    path: "/",
    component: Layout,
    name: "main",
    children: [
      {
        path: "dashboard",
        meta: {
          id: "1",
          name: "控制台",
          path: "/dashboard"
        },
        component: Dashboard
      }
    ]
  }
];

const router = createRouter({
  history: createWebHistory(),
  routes
});

export default router;
